<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>出库单列表</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f7f7f7;
        }

        h1 {
            text-align: center;
            margin-top: 20px;
            color: #333;
        }

        table {
            width: 100%;
            max-width: 800px;
            margin: 20px auto;
            border-collapse: collapse;
            background-color: #fff;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        th, td {
            padding: 12px 15px;
            text-align: left;
            border-bottom: 1px solid #e0e0e0;
        }

        th {
            background-color: #f4f4f4;
        }

        .my-button-container {
            text-align: center;
            margin-bottom: 20px;
        }

        .my-button {
            display: inline-block;
            padding: 8px 16px;
            margin: 5px;
            background-color: #007bff;
            color: #fff;
            text-decoration: none;
            border-radius: 5px;
        }

        .my-button:hover {
            background-color: #0056b3;
        }

        .no-data {
            text-align: center;
            padding: 20px;
            color: #777;
        }

        @media screen and (max-width: 600px) {
            table {
                width: 100%;
            }
            th, td {
                padding: 8px 10px;
            }
            .my-button {
                padding: 6px 12px;
            }
        }
    </style>
</head>

<body>
    <h1>出库单列表</h1>
    <div class="my-button-container">
        <a class="my-button" href="/outbound_order_add">新增其他出库单</a>
    </div>
    <div class="container">
        <table>
            <thead>
                <tr>
                    <th>单据编号</th>
                    <th>客户</th>
                    <th>日期</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <!-- 反向循环渲染入库单数据 -->
                {% if ware_entries %}
                {% for i in range(ware_entries|length-1, -1, -1) %}
                {% set ware_entry = ware_entries[i] %}
                <tr>
                    <td>{{ware_entry[3]}}</td>
                    <td>{{ware_entry[1]}}</td>
                    <td>{{ware_entry[2]}}</td>
                    <td>
                        <a class="my-button" href="/outbound_order_details/{{ware_entry[3]}}">查看详情</a>
                    </td>
                </tr>
                {% endfor %}
                {% else %}
                <tr>
                    <td colspan="4" class="no-data">没有入库单数据。</td>
                </tr>
                {% endif %}
            </tbody>
        </table>
    </div>
</body>

</html>
